﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AppointCultivateContacts.aspx.cs" Inherits="JoinParty.admin.FlowStep.AppointCultivateContacts" %>

<%@ Register Src="../Control/UserMessage.ascx" TagName="UserMessage" TagPrefix="UC" %>
<!DOCTYPE html>

<html>
<head runat="server">
    <title></title>
    <style type="text/css">
        #TaContacts {
            width: 100%;
            margin: 0 10px;
            background-color: #58FAF4;
        }

            #TaContacts th {
                text-align: center;
                height: 20px;
                line-height: 20px;
            }

            #TaContacts td {
                background-color: white;
                height: 20px;
                line-height: 20px;
                padding-left: 2px;
            }
    </style>
    <script type="text/javascript">
        function DeleteContacts(obj, Id) {
            $.ajax({
                type: "POST",
                contentType: "application/json",
                url: "AppointCultivateContacts.aspx/DeleteContacts",
                data: "{ID:'" + Id + "'}",
                dataType: "json",
                success: function (result) {
                    if (result.d == true) {
                        $(obj).parent().parent().remove();
                    }
                    else {
                        alert("删除失败！");
                    }
                }, error: function (XMLHttpRequest) {
                    alert(XMLHttpRequest.status);
                }
            });
        }
    </script>
    <script src="../../../../Resource/js/jquery/jquery.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:HiddenField ID="hdDelete" Value="" runat="server" />
        <asp:HiddenField ID="hdModifyAdmin" Value="" runat="server" />
        <f:PageManager ID="PageManager1" runat="server" />
        <f:ContentPanel ID="Panel2" runat="server" ShowBorder="false" ShowHeader="false" Height="440px">
            <div class="edit-content">
                <div style="padding-left: 20px">
                    <UC:UserMessage ID="UserM" runat="server" />
                </div>
                <div>
                    <table style="width: 100%">
                        <tr>
                            <td colspan="3">
                                <f:DatePicker ID="dtTime" Width="350px" runat="server" DateFormatString="yyyy-MM-dd" ShowRedStar="true" Label="何时开始培养"></f:DatePicker>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <f:TriggerBoxPicker
                                    runat="server" ID="ppUser"
                                    EnableTrigger1PostBack="false" ShowTrigger1="true"
                                    ShowTrigger2="true" Trigger1Icon="Clear"
                                    EnableEdit="false" WindinsTitle="选择培养联系人" EmptyText="选择培养联系人"
                                    WindinsHeight="500px"
                                    WindinsWidth="750px" WindinsUrl="../../../Share/Picker/MemberMultiplePicker.aspx" Label="指定培养联系人：">
                                </f:TriggerBoxPicker>
                            </td>
                            <td>
                                <asp:Button ID="btnEnSure" runat="server" Text="确认" OnClick="btnEnSure_Click" />
                            </td>
                            <td><f:Label runat="server" ID="lbMsg" Label="温馨提示：最多指定两名联系人！" CssStyle="color: red;"></f:Label></td>
                        </tr>
                        <tr>
                            <td colspan="3" style="width: 80%; text-align: center;">
                                <table cellpadding="1" cellspacing="1" id="TaContacts" style="width: 95%">
                                    <asp:Repeater ID="rptContacts" runat="server">
                                        <HeaderTemplate>
                                            <tr>
                                                <th>姓名</th>
                                                <th style="width: 30px;">性别</th>
                                                <th style="width: 100px;">出生日期</th>
                                                <th style="width: 60px;">文化程度</th>
                                                <th style="width: 45px;">籍贯</th>
                                                <th style="width: 100px;">入党时间</th>
                                                <th style="width: 30px;" class="ADelete">操作</th>
                                            </tr>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <tr>
                                                <td><%#Eval("UserName") %></td>
                                                <td style="text-align: center;"><%#Eval("GenderName") %></td>
                                                <td style="text-align: center;"><%#string.Format("{0:yyyy-MM-dd}",Eval("Birthday")) %></td>
                                                <td><%#Eval("Educational") %></td>
                                                <td><%#Eval("NativePlace") %></td>
                                                <td style="text-align: center;"><%#string.Format("{0:yyyy-MM-dd}",Eval("JoinPartyDate")) %></td>
                                                <td style="text-align: center;"><a href="javascript:void(0);" onclick="DeleteContacts(this,'<%#Eval("ID") %>');" class="ADelete">删除</a></td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </f:ContentPanel>
        <f:Panel ID="panelfoot" runat="server" ShowBorder="false" ShowHeader="false" AutoScroll="true">
            <Toolbars>
                <f:Toolbar ID="Toolbar1" runat="server" Position="Bottom" ToolbarAlign="Center">
                    <Items>
                        <f:Button ID="btnSaveClose" ValidateForms="SimpleForm1" Icon="SystemSaveClose" OnClick="btnSaveClose_Click"
                            runat="server" Text="保存并关闭">
                        </f:Button>
                        <f:Button ID="btnSubmit" runat="server" CssClass="marginr" OnClick="btnSubmit_Click" Icon="Tick"
                            Text="提交">
                        </f:Button>
                        <f:Button ID="btnClose" Icon="SystemClose" EnablePostBack="false" runat="server"
                            Text="关闭">
                        </f:Button>
                    </Items>
                </f:Toolbar>
            </Toolbars>
        </f:Panel>
    </form>
</body>
</html>
<script type="text/javascript">
    $(function () {
        if ($("#hdDelete").val() == "1") {
            $(".ADelete").remove();
        } else {
            $(".ADelete").show();
        }
    })
</script>
